#include <XTimeAdapter.h>
#include <iostream>
#include <ctime>

int main(int argc, char* argv[])
{
	IceUtil::Time icTime = IceUtil::Time::now();

	std::cout << icTime.toDateTime() << std::endl;

	Xts::Util::XTimeAdapter timeAdapter(icTime);

	long localtime_interval;
	_get_timezone(&localtime_interval);

	std::cout << "Local time interval" << localtime_interval << ", Time zone" << localtime_interval / 3600 << std::endl;

	Xts::Util::XTimezoneDateTime cnDtTime = timeAdapter.ToXTimezoneDateTime(localtime_interval);

	std::cout << "cn:" << cnDtTime.Year() << "-" << cnDtTime.Month() << "-" << cnDtTime.Day() << "T"
		<< cnDtTime.Hour() << ":" << cnDtTime.Minute() << ":" << cnDtTime.Second() << ", "
		<< cnDtTime.Milisec() << "," << cnDtTime.Microsec() << std::endl;

	Xts::Util::XTimezoneDateTime usDtTime = timeAdapter.ToXTimezoneDateTime(Xts::Util::XTimeZone::UTCW05);

	std::cout << "us:" << usDtTime.Year() << "-" << usDtTime.Month() << "-" << usDtTime.Day() << "T"
		<< usDtTime.Hour() << ":" << usDtTime.Minute() << ":" << usDtTime.Second() << ", "
		<< usDtTime.Milisec() << "," << usDtTime.Microsec() << std::endl;

	
}